<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            background-color: black;
        }
        .container{
            /* ackground-color: pink; */
            width: 300px;
            height: 300px;
            padding: 20px 20px;
            margin: 50px 50px;
        }
        .person{
           position: absolute; 
           width: 150px;  
           height: 150px;
        left: 150px;
        top: 150px;
        animation: sprint 3s infinite ease-in;
        }
        .head{
            position: absolute;
            width: 30px;
            height: 30px;
            border: 3px solid white;
            border-radius: 50%;
            top: -30px;
            left: -6px;
            animation: bob 2s infinite alternate;
        }
       .torso{
        position: absolute;
        width: 0px;
        height: 60px;
        border-left: 3px solid #fff;
        left:0px;
        top: 3px;
       }
       .person .part{
        position: absolute;
        left: 0px;
        top: 15px;
       }
       .person .part.arm{
        width: 40px;
        height: 45px;
        border-left: 3px solid #fff;
        border-bottom: 3px solid #fff;
        position: absolute;
        transform-origin: 0% 0% 0px;
        animation: pump 1s infinite ease-in-out;
       }
       .person .part.arm.one{
        transform: rotate3d(0,0,1,80deg);
       }
       .person .part.arm.two{
        transform: rotate3d(0,0,1,-80deg);
        animation-delay: 0.5s;
       }
       .person .part.leg{
        width: 60px;
        height: 60px;
        border-right: 3px solid #fff;
        border-top: 3px solid #fff;
        position: absolute;
        transform-origin: 0% 0% 0px;
        top: 60px;
        left: 2px;
        animation: run 1s infinite ease-in-out;
       }
       .person .part.leg.one{
        transform: rotate3d(0,0,1,100deg);
       }
       .person .part.leg.two{
        transform: rotate3d(0,0,1,10deg);
        animation-delay: 0.5s;
       }
       /*头部动画*/
       @keyframes bob{
        0%{
            transform:rotate3d(0,0,1,5deg);
        }
        25%{
            transform:rotate3d(0,0,1,-30deg) skew(15deg,0deg);
        }
        50%{
            transform:rotate3d(0,0,1,5deg);
        }
        75%{
            transform:rotate3d(0,0,1,-30deg) skew(15deg,0deg);
        }
        100%{
            transform:rotate3d(0,0,1,20deg) skew(-15deg,0deg);
        }
       }
  /*胳膊摆动动画*/
       @keyframes pump{
        0%{
            transform:rotate3d(0,0,1,80deg);
        }
        50%{
            transform:rotate3d(0,0,1,-70deg);
        }
        100%{
            transform:rotate3d(0,0,1,80deg);
        }
       }
       /*腿部摆动动画*/
       @keyframes run{
        0%{
            transform:rotate3d(0,0,1,-5deg);
        }
        50%{
            transform:rotate3d(0,0,1,150deg);
        }
        100%{
            transform:rotate3d(0,0,1,-5deg);
        }
       }
       /*火柴人向前奔跑*/
       @keyframes sprint{
        0%{
            transform:translate(-200px,0px);
        }
        100%{
            transform:translate(1800px,0px);
        }
       }
    </style>
</head>
<body>
 <!--火柴人的结构-->  
 <div class="container" >
    <div class="person">
        <div class="head"></div>
        <div class="part arm one"></div>
        <div class="part arm two"></div>
        <div class="torso"></div>
        <div class="part leg one"></div>
        <div class="part leg two"></div>
    </div>
 </div>
</body>
</html>